<?
include 'includes/specs_functions.php';
echo printGoogleAnalytics();
#-------------------------------$Session information
$THEME = $_POST["THEME"];
#---------------------------------------------------

$output = "
	<script>
		function query(cnt, fil, dir){
			var params = {	user: $('#user').val() 
							,slevel: $('#slevel').val()
							,elevel: $('#elevel').val() 
							,job: $('#job').val()
							,amount: cnt
							,filter: fil
							,direction: dir
						};
			
			$('#search-results-out').css({height: $('#search-results').height()});
			// fade out inner div
			$('#search-results').fadeOut('fast' , function(){
				// change the div content
				$('#search-results').html('<div class=\"center\"><div class=\"center loader-gif\" style=\"top:262px;position: relative;\"></div></div>');
				$('#search-results').fadeIn('fast');
				
				$('#search-results').load('specs/php/query.php?".time()."', params, function(response, status, xhr) {
				  if (status == 'error') {
					var msg = 'Sorry but there was an error: ';
					$('#search-results').html(msg + xhr.status + ' ' + xhr.statusText);
				  }else{
					$('#search-results-out').animate({height: $('#search-results').height()}, function(){
						// show the inner div
						$('#search-results').fadeIn('fast');
					});
				  }
				});
			});
		}
		
		$(document).ready(function(){
			query(\"\", \"\", \"\");

		});
	</script>
	<!--<div class = 'content-title-container'>
		<div class='normal-text grey-text content-title-text fl-left'>Specs</div>
		<ul id='sub-menu-item-list'><li class='menu-item normal-text bold-text menu-item-selected'>Browse</li><li class='menu-item bold-text normal-text'>Create</li><li class='menu-item bold-text normal-text'>Import</li></ul>
	</div>-->
	<div id='indent-content-container' class='me-content-container'>
		<div id='mask-content-container' class='fl-left'>
			<div class = 'content-subtitle-container-left fl-left' style='height: 125px;'></div>
			<div class='fl-right'>
				<div id='search-mask' class='fl-left' style='width: 712px;'>
				<!-- FILTER -->
					<form method='POST' action='javascript:query(\"\", \"\", \"\");'>
						<div class='fl-left' style='height: 64px; padding-top: 7px; padding-left: 10px;'>	
							<table>
								<tr>
									<td class='td-table vertical-middle' style='width: 90px;'>
										<div class='normal-text bold-text '>Character:</div>
									</td>
									<td colspan=4'>
										<input id='user' type='text' style='width:200px'>
									</td>
								</tr>
								<tr>
									<td class='td-table vertical-middle' > 
										<div class='normal-text bold-text '>Level:</div>
									</td>
									<td style='width: 50px;'>
										<select id='slevel' name='slevel' size='1' class='select'>";
											$i = 1;
											while ($i<51){
												$output .= "<option value='".$i."'";
												if($i==1){
													$output .= " selected ";
												}
												$output .= ">".$i."</option>";
												$i++;
											}
										$output .= "</select>
									</td>
									<td style='width: 105px;'>
										<div class='normal-text bold-text ' style='padding:10px;text-align: center;'> - </div>
									</td>
									<td  colspan='2' style='width: 50px;'>
										<select id='elevel' name='elevel' size='1' class='select' style='margin-left: 0;'>";
											$i = 1;
											while ($i<51){
												
												$output .= "<option value='".$i."'";
												if($i==50){
													$output .= " selected ";
												}
												$output .= ">".$i."</option>";
												$i++;
											}
										$output .= "</select>
									</td>
								</tr>
								<tr>
									<td class='td-table vertical-middle'>
										<div class='normal-text bold-text'>Class:</div>
									</td>
									<td  colspan='3'>
										<select id='job' size='1'  class='select' style='width:209px;'>
											<option id='-1' value='none'></option>";
											foreach (GetClassList() as $id => $class){
												$output .= "<option id='".$id."' value='".$class."'>".$class."</option>";
											}
										$output .= "</select>
									</td>
									<td style='width: 378px;'>
										<div>
											<div class='fl-right'>
												<input id='reset-button' type='reset' value='Reset' style='cursor:pointer;'/>
												<input id='search-button' type='submit' value='Search' style='cursor:pointer;'/>
												
											</div>
										</div>
									</td>
								</tr>
							</table>
						</div>
						<div style='clear:both;'></div>
						
					</form>
				</div>	
				<div class = 'content-subtitle-container-right fl-right' style='height: 125px;'></div>
			</div>
		</div>
		<div style='clear:both; height:5px;'></div>
		<div class='content-subtitle-container-open'></div>
			<div id='search-results-out' style='margin-top: 20px;'>
				<div id='search-results' style='min-height: 540px;'>

				</div>
			</div>
		<div class='content-subtitle-container-close'></div>
	</div>";
		
echo $output;

?>


		
